﻿@{
    ViewBag.Title = "CourseDetail";
    Layout = "~/Views/Shared/_BasicLayout.cshtml";
}
<script type="text/javascript">
    var action = com.get.action;
    var id = com.get.id;
    if (action == "edit")
    {
        com.ajax({
            url: '/BD/CourseBD/getCourseInfo',
            data: { "id": id },
            success:function(data)
            {
                $("#form1").form("load", data);
            }
        });
    }
    function funcSave() {
        if ($("#form1").form("validate")) {
            var total = com.serializeObj("form1");
            if (action == "add")
            {
                com.ajax({
                    url: '/BD/CourseBD/AddCourse',
                    data: total,
                    success: function (data) {
                        com.message("information", "添加成功");
                    }
                });
            }
            else if(action=="edit")
            {
                com.ajax({
                    url: '/BD/CourseBD/EditCourse?id=' + id,
                    data: total,
                    success: function (data) {
                        com.message("information", "修改成功");
                    }
                });
            }
        }
    }
</script>
<div id="btns" style="height:100%;width:100%">
    <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="funcSave()">保存</a>
</div>
<div id="divTotal" style="height: 550px; width: 100%; overflow: auto">
    <div id="master" class="container_12" style="height: auto; align-items: center">
        <form id="form1" name="my_form">
            <input id="ID" type="hidden" name="ID" />
            <div class="grid_12 lbl" style="text-align: center;font-size: 24px; font-weight: bold">
                课程信息
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                科目名称:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="CourseTypeID" class="easyui-combobox" name="CourseTypeID" data-options="valueField:'value',textField:'text',url:'/BD/CourseType/GetCourseTypeCombo',panelHeight:'auto',required: true,editable: false," />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                课程名称:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Name" class="easyui-textbox" name="Name" data-options="required: true" />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                学年:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Year" class="easyui-combobox" name="Year" data-options="valueField:'value',textField:'text',url:'/Course/GetYear',panelHeight:'auto',editable: false," />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                学期:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Term" class="easyui-combobox" name="Term" data-options="valueField:'value',textField:'text',data:StaticCombo.Term,panelHeight:'auto',editable: false," />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                年级:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Grade" class="easyui-combobox" name="Grade" data-options="valueField:'value',textField:'text',url:'/BD/GradeType/GetGradeTypeInfo',panelHeight:'auto',editable: false," />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                采用教材:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Book" class="easyui-textbox" name="Book"/>
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                计算方式:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="AccountForm" class="easyui-combobox" name="AccountForm" data-options="valueField:'value',textField:'text',data:StaticCombo.AccountForm,panelHeight:'auto',editable: false," />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                课时:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Number" class="easyui-textbox" name="Number" />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                价格:
            </div>
            <div class="grid_2 seaval" style="text-align: left;">
                <input id="Price" class="easyui-numberbox" name="Price" />
            </div>
            <div class="grid_2 sealbl" style="text-align: right;">
                备注:
            </div>
            <div class="grid_4 seaval" style="text-align: left;">
                <input id="Note" name="Note" class="easyui-textbox" style="height:80px;width:680px;" data-options="multiline:true" />
            </div>
        </form>
    </div>
</div>

